﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using PPI.Data.Inspection;
using PPI.Entities.Interface;
using PPI.Mobile;

namespace PPI.ServiceLogic.Inspections
{
    public class LInspectionType : IMobileTable
    {
        public static DataSet SelectAllIdName(string connectionKey)
        {
            return DInspectionType.SelectAllIdName(connectionKey);
        }

        public List<EMobileQuery> CreateInsertMobileQuery(string connectionKey)
        {
            List<EMobileQuery> listQueries = new List<EMobileQuery>();

            listQueries.Add(new EMobileQuery("Delete tb_InspectionTypes"));
            DataTable dt = SelectAllIdName(connectionKey).Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                //dr["Inspection_TypeId"]
                //dr["Name"]
                listQueries.Add(new EMobileQuery("Insert into tb_InspectionTypes(InspectionTypeId,Name) values(" + dr["Vendor_InspVisit_XmissionStructures_Inspection_TypeId"] + ",'" + dr["Name"] + "') "));
            }

            return listQueries;
        }
    }
}
